package com.heriparid.fragmentinjection.modules;

import javax.inject.Singleton;

import com.heriparid.fragmentinjection.annotations.ForApplicationContext;

import android.content.Context;
import android.location.LocationManager;
import dagger.Module;
import dagger.Provides;

@Module(
	library = true
)
public class AndroidModule {

	private final Context mApplicationContext;
	
	public AndroidModule(Context context) {
		mApplicationContext = context;
	}
	
	@Provides
	@Singleton
	@ForApplicationContext
	Context	provideApplicationContext(){
		return mApplicationContext;
	}
	
	@Provides
	@Singleton
	LocationManager provideLocationManager(){
		return (LocationManager) mApplicationContext.getSystemService(Context.LOCATION_SERVICE);
	}
	
}
